signature MIR_STRUCTS =
sig
structure Ir : IR2
end

signature MIR =
sig
  include MIR_STRUCTS

  datatype mir_aop 
    = PLUS 
    | MINUS
    | MUL
    | DIV
    | MOD
    | AND
    | OR
      
  datatype mir_cop
    = NE  
    | EQ  
    | LE
    | LT
    | GE
    | GT

  datatype mir_exp 
    = DUMMY
    | CONST of int
    | PCONST of Ir.mytype 
    | NAME of string
    | TEMP of string * (mir_lnode list) 
    | BINOP of mir_aop * mir_exp * mir_exp 
    | UOP of mir_exp 
    | MEM of mir_exp * int 
    | CALL of string * (mir_exp list)

    | ARRAYEX of mir_exp * int 
    | PTREX of mir_exp * int

  and mir_lnode
    = Label of string * int
    | JMP of string
    | CJMP of mir_cop * mir_exp * mir_exp * string * string
    | EXP of mir_exp
    | MOV of mir_exp * mir_exp

  type mir_fun = mir_lnode list

  type mir_data = (string * int) list  
  
  val newLbInf : Ir.exp -> int

  val getLbInf : int -> Ir.exp option 

end
